#define _CRT_SECURE_NO_WARNINGS
bool canJump(int* nums, int numsSize)
{
    int i = 0;
    int cover = 0;
    while (i <= cover)
    {
        if (cover >= numsSize - 1)
        {
            return 1;
        }
        if (nums[i] + i > cover)
        {
            cover = nums[i] + i;
        }
        i++;
    }
    return 0;
}